home *** CD-ROM | disk | FTP | other *** search
-
- /*******************************************************************************
- ********************************************************************************
- ********************************************************************************
-
- PERMISSION TO COPY THIS SOFTWARE IS HEREBY GIVEN BY THE AUTHOR PROVIDED THAT
- THIS LEADING MESSAGE IS INCLUDED IN ALL OF THE RELEVANT SOURCE FILES.
-
- P. SCHMITZ, UNIVERSITY OF KEELE, MAY 1988.
-
-
- ********************************************************************************
- ********************************************************************************
- *******************************************************************************/
-
-
- #include <stdio.h>
- #include <sys/ioctl.h>
- #include <sgtty.h>
- #include <signal.h>
-
- #define STARTENERGY 500
- #define STARTPHASER 15
- #define STARTPHOTON 10
- #define WEAPONREACH 6
- #define PHOTONPOWER 60
- #define PHASERPOWER 40
- #define MAXWARP 1
- #define FLAG 2
- #define ON 1
- #define OFF 0
- #define ROMID 'R'
- #define KLINGID 'K'
- #define MAXALIENS 3
-
-
- struct sgttyb params;
-
- char *tgoto();
- char *tgetstr();
- extern char *BC;
- extern char *UP;
- char bp[1024];
- char tbp[1024];
- char *termp;
-
- /*variables for unbuffered input&output*/
- #define BUFSIZE 512
- long noofchars;
- /*variables for unbuffered input&output*/
-
- /*variables for universe array*/
- struct thing {
- int x;
- char c;
- struct thing *next_thing;
- };
-
- struct thing *univ[918],*xp;
- /*variables for universe array*/
-
- /*variables for the torpedos*/
- struct torpedo {
- char weapon;
- int life;
- int xpos;
- int ypos;
- int oldxpos;
- int oldypos;
- int xvel;
- int yvel;
- struct player *whofrom;
- struct torpedo *next;
- };
-
- struct torpedo *tstartlist,*ttaillist,*txp,*ta;
- /*variables for the torpedos*/
-
- /*variables for a player*/
- struct player {
- int reason;
- char id; /*playing id*/
- char buf[BUFSIZE]; /*persons input buffer*/
- char message[57]; /*to radio others!*/
- int messindex;
- int buftop,bufptr; /*pointers to buffer for that person*/
- char terminalfile[14];
- char cm[20];
- char cl[20];
- int tty_type;
- int shipno;
- int fd; /*file descriptor to the tty file */
- /*horizontal size of window, IT MUST BE AN ODD NO!*/
- int pid; /*pid of process to be killed if this guy leaves the game*/
- /* plus all the other stuff a player needs!!! */
- int oldxpos;
- int oldypos;
- int xpos;
- int ypos;
- int xvel;
- int yvel;
- int maxvel;
- int energy;
- int maxenergy;
- int cloakingdevice;
- int beeping;
- int phaserbanks;
- int maxphaser;
- int photontorpedos;
- int maxphoton;
- int photonreach;
- int photonpower;
- int phaserreach;
- int phaserpower;
- int weaponselect; /*0=phaser, 1=photon*/
- int score;
- int shields;
- int oldstat;
- int stat;
- int chflg;
- int clflg;
- struct lock_on
- {
- struct player *enemy;
- int xloc;
- int yloc;
- } channel[4];
- int flyto;
- int planets[30];
- int planetno;
- int doneit;
- int impulsemove;
- struct player *next;
- };
-
- struct player *player,*startlist,*taillist;
-
- int players[10];
- /*variables for a player*/
- int debug;
- int noofaliens,noofsignals,noofplayers;
-
- /*global general usage variables*/
-
- int v,i,j,z,r,k,l,x,y,storm;
- char c;
-
-